package org.eclipselabs.egf.portfolio.task.scala.test.string

import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.egf.core.EGFCorePlugin
import org.eclipse.egf.core.producer.InvocationException
import org.eclipse.egf.ftask.producer.context.ITaskProductionContext
import org.eclipse.egf.ftask.producer.invocation.ITaskProduction

class StringEquals extends ITaskProduction{
	
	def preExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor ) ={
	}
	
	def doExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
		var first = taskProductionContext.getInputValue("firstStringEquals", classOf[String])
		var second = taskProductionContext.getInputValue("secondStringEquals", classOf[String])
		var append = taskProductionContext.getInputValue("appendStringEquals", classOf[String])
		var firstTrue = taskProductionContext.getInputValue("firstStringEquals", classOf[String])
		var secondTrue = taskProductionContext.getInputValue("secondStringTrueEquals", classOf[String])
		var appendTrue = taskProductionContext.getInputValue("appendStringTrueEquals", classOf[String])
		if(first == firstTrue && second == secondTrue && append == appendTrue){
			EGFCorePlugin.getDefault().logWarning("Test Passed")
		}
		else
			EGFCorePlugin.getDefault().logError("Test Failed")
	}
	
	def postExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
	}
}